﻿function filterCompany(IsViewArchived) {
    $("#divListCompany").html("<div class='ajax-loading'></div>");
    var companyName = $("#CompanyName").val();
    var showArchived = $("#cbArchive").is(":checked");
    $.ajax({
        url: '/Contact/ListCompany',
        data: { companyName: companyName, showArchived: showArchived },
        success: function (data) {
            $("#divListCompany").html(data);
            InitDatatable();
        }
    });
}

function ViewCompanyDetails(companyId) {
    $.ajax({
        url: '/Contact/CompanyDetails',
        data: { companyId: companyId},
        success: function (data) {
            $("#ViewDetails").html(data);
        }
    });
}


function filterByArchive()
{
    var isChecked=$("#cbArchive").is(":checked");
    $("#tableCompany .archive1").each(function () {
        if (isChecked)
            $(this).show();
        else
            $(this).hide();
    });
}
